import React, { Component, PropTypes } from 'react'
import { Icon } from 'antd-mobile'

export default class AccountRow extends Component {
  render() {
    const { title, rgtExtra, lftIcon, className, onClick } = this.props
    return (
      <div
        className={`cm-row-box ${className ? className : ''}`}
        onClick={onClick}
      >
        <div className={`cm-left-box`}>
          <i className={`iconfont icon-${lftIcon ? lftIcon : 'question'}`}></i>
          <span>{title}</span>
        </div>

        <div className={`cm-right-box`}>
          {rgtExtra ? rgtExtra : null}
          {/*<i className={`iconfont icon-question`}></i>*/}
          <Icon type="right" />
        </div>
      </div>
    )
  }
}

AccountRow.propTypes = {
  title: PropTypes.string.isRequired,
  rgtExtra: PropTypes.node,
  lftIcon: PropTypes.string,
  className: PropTypes.string,
  onClick: PropTypes.func,
}